package com.eu.ebpm.engine.entity.args;

import java.util.HashMap;
import java.util.Map;

public class Param {

	protected Map<String, Object> args = new HashMap<String, Object>();

	protected Param() {
	}

	public Param add(String name, Object value) {
		args.put(name, value);
		return this;
	}

	public Map<String, Object> put(String name, Object value) {
		args.put(name, value);
		return args;
	}

	@SuppressWarnings("unchecked")
	public <T> T get(String name) {
		return (T) args.get(name);
	}

	public Map<String, Object> getMap() {
		return args;
	}
	
	public static Param init(String name, Object value) {
		return new Param().add(name, value);
	}

	public static Map<String, Object> map(String name, Object value) {
		return new Param().put(name, value);
	}

}
